package model

type User struct {
	Id               int64  `gorm:"column:id;not null;type:int(11)  primary key auto_increment;comment:'自增id'"`
	UserNumber       string `gorm:"column:user_number;comment:'用户编号'"`
	Name             string `gorm:"column:name;comment:'用户名称'"`
	NickName         string `gorm:"column:nick_name;comment:'用户昵称'"`
	Email            string `gorm:"column:email;comment:'邮箱'"`
	PassWord         string `gorm:"column:password;comment:'用户密码'"`
	Phone            string `gorm:"column:phone;comment:'联系电话'"`
	Tag              int8   `gorm:"column:tag;comment:'标签'"`
	Status           int8   `gorm:"column:status;comment:'用户账户状态 -1:未审核或者拒绝 1:启用 2:禁用'"`
	LoginTime        int64  `gorm:"column:login_time;comment:'登录时间'"`
	LoginLocation    string `gorm:"column:login_location;comment:'登陆位置'"`
	Pid              int64  `gorm:"column:pid;comment:'父账号id'"`
	IsChild          int8   `gorm:"column:is_child;comment:'是否子账户 1-是 2-不是'"`
	UserType         int8   `gorm:"column:user_type;comment:'用户类型 1、管理员admin 2、普通用户'"`
	OpenId           string `gorm:"column:openId;comment:'微信公众号gopenid'"`
	ApplyTime        int64  `gorm:"column:apply_time;<-:create;comment:'账户注册申请时间'"`
	RegisterTime     int64  `gorm:"column:register_time;comment:'注册时间（审核通过）'"`
	RegisterLocation string `gorm:"column:register_location;comment:'注册填写位置'"`
	Address          string `gorm:"column:address;comment:'账户地址'"`
	Files            string `gorm:"column:files;comment:'申请文件名称'"`
	AuditStatus      int8   `gorm:"column:audit_status;comment:'审核状态 -1:未审核  1:审核通过 2:审核驳回'"`
	AuditRemark      string `gorm:"column:audit_remark;comment:'审核意见'"`
	Remark           string `gorm:"column:remark;comment:'备注/申请信息/客户信息'"`
	AccountType      int8   `gorm:"column:account_type;comment:'账号类型'"` // 账号类型 预留
	BaseInt
}

func (u User) TableName() string {
	return "users"
}

type AuditStatus int8

const (
	AuditPending  AuditStatus = iota - 1 // 待审核
	AuditApproved             = iota     // 审核通过
	AuditReject                          // 拒绝
)
